import Vue from 'vue'
import App from './App.vue'

import VueRouter from 'vue-router'
Vue.use(VueRouter)
import UIRouter from './views/UIRouter'
import Contacts from './views/Contacts'
import About from './views/About'
import All from './views/child/All'
import Alice from './views/child/Alice'
import Bob from './views/child/Bob'
import Blog from './views/child/child2/Blog'
import Fax from './views/child/child2/Fax'
const routes = [
  {
    path: '/',
    redirect: 'uirouter'
  },
  {
    path: '/uirouter',
    component: UIRouter
  },
  {
    path: '/contacts',
    component: Contacts,
    children: [
      {
        path: 'all',
        component: All
      },
      {
        path: 'alice',
        component: Alice
      },
      {
        path: 'alice',
        component: Alice
      },
      {
        path: 'bob',
        component: Bob,
        children: [
          {
            path: 'blog',
            component: Blog
          },
          {
            path: 'fax',
            component: Fax
          }
        ]

      }
    ]
  },
  {
    path: '/about',
    component: About
  }
]

const router = new VueRouter({
  routes
})

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
